<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script>
function addorder()
{
	$('#addstorageform').modal('show');	
}
</script>
<title>FBA退款报表</title>
<style type="text/css">
.stdtable tbody tr td{padding:3px 5px;}
</style>
<body class="withvernav">
{{include file='/public/leftmenu.tpl'}}
    <div class="pageheader notab">
      <h1 class="pagetitle">FBA退款报表</h1>
      <span class="pagedesc"></span>
       <div class="menulist">
		<ul class="profile_summary">
       <li {{if $countType==''}} class="current"{{/if}}> <a href="/report/fbaRefund"><span>按店铺统计退款数据</span></a></li>
       <li {{if $countType=='goods'}} class="current"{{/if}}> <a href="/report/fbaRefund?countType=goods"><span>按商品统计退款数据</span></a></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
{{if $countType==''}}
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
<form class="stdform stdform2" method="get" action="/report/fbaRefund">
    <div style="" class="tableoptions">
    	<input type="hidden" name="op" id="op" value="saleCounts">
        <input type="hidden" name="program_id" value="{{$program.id}}" />
      <div style="line-height:28px;">
      <select name="timetype" id="timetype" class="selection" style="width:100px;" >
        <option value="1" {{if $timetype==1}} selected{{/if}}>订单时间</option>
        <option value="2" {{if $timetype==2}} selected{{/if}}>导入时间</option>
        <option value="3" {{if $timetype==3}} selected{{/if}}>退款时间</option>
      </select>：<input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> 
     &nbsp; <span id="search_list">{{$shopname|getstr:35}}</span>
<input name="shopname" id="shopname" type="hidden" value="{{$shopname}}" />
<span id="choose_shop_btn" style="border:1px solid #ccc;padding:6px 5px 7px;border-radius:3px;cursor:pointer;" onClick="getShopList()">选择店铺 <img src="/fuman/images/search_down.png" width="14" height="21" align="absmiddle" style="margin-bottom:-4px;"></span> 排序方式：<select name="orderdata" class="selection" style="width:100px;">
        <option value="1" {{if $orderdata==1}} selected{{/if}}>按退款笔数</option>
        <option value="4" {{if $orderdata==4}} selected{{/if}}>按退款笔数占比</option>
        <option value="2" {{if $orderdata==2}} selected{{/if}}>按退款金额</option>
        <option value="3" {{if $orderdata==3}} selected{{/if}}>按退款金额占比</option>
    </select>
       <button class="btn btn_orange btn_search radius50">Search</button>
       <span class="page" style="background-color#fff;border:none;">
       <a href="/order/amazonfba?status=3&ty={{if $timetype==3}}1{{else}}{{$timetype}}{{/if}}&starttime={{$starttime}}&endtime={{$endtime}}" target="_blank">查看详细退款...</a></span>
 </div>
    </div>
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr valign="top" style="height:20px">
<td colspan="5" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">按店铺统计金额与退款率</td>
</tr>
<tr valign="top" style="height:20px">
  <td height="20"  style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">店铺</td>
  <td height="20" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款笔数/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款金额/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易笔数</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易金额</td>
  </tr>
</thead>

 {{foreach from=$shop_refundlist item=res key=key}}
<tr>
  <td  align="center">{{$res.shopname}}</td>
  <td  align="center">{{$res.order_num}}/{{$res.num_mod}}%</td>
  <td  align="center">{{$res.refund_total}}/{{$res.amount_mod}}%</td>
  <td  align="center">{{$res.all_order_num}}</td>
  <td  align="center">{{$res.amount_total}}</td>
</tr>
{{/foreach}}
<tr>
{{if $searchdata neq 'nosearch'}}
<td class="head1" align="center"><B>合计</B></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num}}/{{$refund_num_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num_money}}/{{$refund_num_money_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$allsubtotal}}</B></font></td>
<td class="head1" align="center"><font color="#FF0000"><B>{{$allcosprice}}</B></font></td>
</tr>
{{/if}}
</table>          
</div></div>
{{else}}
<div id="contentwrapper" class="contentwrapper">
<form class="stdform stdform2" method="get" action="/report/fbaRefund">
    <div style="" class="tableoptions">
    	<input type="hidden" name="countType" id="countType" value="goods">
      <div style="line-height:28px;"><select name="timetype" id="timetype" class="selection" style="width:100px;" >
        <option value="1" {{if $timetype==1}} selected{{/if}}>订单时间</option>
        <option value="2" {{if $timetype==2}} selected{{/if}}>导入时间</option>
        <option value="3" {{if $timetype==3}} selected{{/if}}>退款时间</option>
      </select>：<input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> 
    SKU：<input type="text" name="goods_sku" id="goods_sku" class="width100" value="{{$goods_sku}}" placeholder="商品SKU" /> 排序方式：<select name="orderdata" class="selection" style="width:100px;">
        <option value="1" {{if $orderdata==1}} selected{{/if}}>按退款笔数</option>
        <option value="2" {{if $orderdata==2}} selected{{/if}}>按退款金额</option>
        <option value="3" {{if $orderdata==3}} selected{{/if}}>按金额占比</option>
    </select>
    
       <button class="btn btn_orange btn_search radius50">Search</button>
 </div>
    </div>
    </form>
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr valign="top" style="height:20px">
<td colspan="6" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">按商品统计退款金额与退款率</td>
</tr>
<tr valign="top" style="height:20px">
  <td height="20"  style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">商品SKU</td>
  <td  style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">商品名称</td>
  <td height="20" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款笔数/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款金额/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易笔数</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易金额</td>
  </tr>
</thead>

{{foreach from=$shop_refundlist item=res key=key}}
<tr>
  <td  align="center">{{$res.sku}}</td>
  <td  align="center" title="{{$res.goods_name}}">{{$res.goods_name|getstr:12:0}}</td>
  <td  align="center">{{$res.order_num}}/{{$res.num_mod}}%</td>
  <td  align="center">{{$res.refund_total}}/{{$res.amount_mod}}%</td>
  <td  align="center">{{$res.all_order_num}}</td>
  <td  align="center">{{$res.amount_total}}</td>
</tr>
{{/foreach}}
<tr>
  <td class="head1" align="center"><B>合计</B></td>
{{if $searchdata neq 'nosearch'}}
<td class="head1" align="center">&nbsp;</td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num}}/{{$refund_num_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num_money}}/{{$refund_num_money_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$allsubtotal}}</B></font></td>
<td class="head1" align="center"><font color="#FF0000"><B>{{$allcosprice}}</B></font></td>
</tr>
{{/if}}
</table>
</div>
{{/if}}
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
<div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择要搜索的店铺</h4><span style="float:right">
  <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
  <input type="button" value="关闭弹层" onClick="closeShowBox()">
</span></div>
<div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript" src="/fuman/js/report.js"></script>
</body>
</html>